﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoCopier.Extra
{
    public static class StringExt
    {
        public static string Truncate(this string source, int length, string EndToken = "...")
        {
            if (source.Length <= length)
                return source;


            source = source.Substring(0, length);

            return string.Format("{0}{1}", source, EndToken);
        }

        public static List<string> RemoveNullOrWhiteSpace(this IEnumerable<string> source)
           {
               return source.Where(x => !string.IsNullOrWhiteSpace(x)).ToList();
           }
    }

   

}
